package com.cgx.tablet.beeper.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.cgx.tablet.beeper.R;
import com.cgx.tablet.beeper.adapter.viewholder.WinTransViewHolder;
import com.cgx.tablet.beeper.bean.WinTransBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/9/12 0012.
 */

public class WinTransAdapter extends BaseRecycleViewAdapter<WinTransBean, WinTransViewHolder>{
    private OnItemClickListener onItemClickListener;
    private List<WinTransBean> winTransBeans = new ArrayList<>();
    private LayoutInflater layoutInflater;

    public interface OnItemClickListener {
        void onItemClick(View view, int pos, List<WinTransBean> mData);
    }

    public WinTransAdapter(Context context, @NonNull List<WinTransBean> mData) {
        super(context, mData);
        layoutInflater = LayoutInflater.from(context);
        this.winTransBeans = mData;
    }

    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
    }

    @NonNull
    @Override
    public WinTransViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new WinTransViewHolder(layoutInflater.inflate(R.layout.item_win_trans, parent, false), onItemClickListener, winTransBeans);
    }
}
